import 'babel-polyfill'
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'config/axios'
import VueAxios from 'vue-axios'
import Es6Promise from 'es6-promise'
import KalixVueNavigate from './components/navigate'
import KalixVueLib from 'kalix-vue-lib/src/main/index'
import KalixVueBiz from 'kalix-vue-biz/src/main/index'
import KalixVueAdmin from 'kalix-vue-admin/src/lib/index'
import KalixVueOA from 'kalix-vue-oa/src/main/index'
import KalixVueCommon from 'kalix-vue-common/src/main/index'
// import KalixVueResearch from 'kalix-vue-research/src/lib/index'
// import KalixVueArt from 'kalix-vue-art/src/lib/index'
import KalixVueEducational from 'kalix-vue-educational/src/lib/index'
import KalixVueEnrolment from 'kalix-vue-enrolment/src/lib/index'
import KalixVueExam from 'kalix-vue-exam/src/main/index'
import './element-ui'
import Tinymce from './components/Tinymce'
import Squire from './components/squire/Squire'
// import KalixVueExam from 'kalix-vue-exam/src/main/index.js'
import Global from './global'
import './icons'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import '@/assets/css/fa-font.css'
import '@/assets/css/icon-font.css'
import '@/assets/stylus/base.styl'
// Vue.use(ElementUI)

Es6Promise.polyfill()
Vue.config.productionTip = false
NProgress.configure({showSpinner: false})

router.beforeEach((to, from, next) => {
  NProgress.start()
  next()
})

router.afterEach(transition => {
  NProgress.done()
})

Vue.use(Global)
Vue.use(VueAxios, axios)
Vue.use(KalixVueLib)
Vue.use(KalixVueBiz)
Vue.use(KalixVueNavigate)
// Vue.use(KalixVueExam)

// const router = KalixRouter(Vue)

Vue.component(Squire.name, Squire)
Vue.component(Tinymce.name, Tinymce)
// 全局加载方式
Vue.use(KalixVueAdmin)
Vue.use(KalixVueOA)
Vue.use(KalixVueCommon)
// Vue.use(KalixVueResearch)
// Vue.use(KalixVueArt)
Vue.use(KalixVueEducational)
Vue.use(KalixVueEnrolment)
Vue.use(KalixVueExam)
// 异步加载方式
// let moduleArr = []
// Vue.use(KalixVueAdmin)
// moduleArr.push(Vue.prototype.$module)
// Vue.use(KalixVueOA)
// moduleArr.push(Vue.prototype.$module)
// Vue.prototype.$modulePlugins = moduleArr
Vue.prototype.HOST = '/api'
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  render: h => h(App)
})
